package com;

import com.service.UserService;
import com.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestHelloSpring
{
    public static void main(String[] args){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        HelloSpring helloSpring = (HelloSpring)context.getBean("helloSpring");
        helloSpring.show();

        UserService userService = (UserService)context.getBean("userService");
        boolean flag=userService.login("张三","123");
        if(flag){
            System.out.println("登陆成功");
        }
        else{
            System.out.println("登陆失败");
        }
    }
}
